home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / VBASIC / VBDLH02.ZIP / VBDE_SRC.ZIP / VBDEVEW.FRM (.txt) < prev   
Encoding:
Visual Basic Form  |  1996-03-08  |  10.4 KB  |  273 lines

  1. VERSION 2.00
  2. Begin Form frmOptView 
  3.    BackColor       =   &H8000000F&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Properties"
  6.    ClientHeight    =   3195
  7.    ClientLeft      =   1230
  8.    ClientTop       =   1710
  9.    ClientWidth     =   7245
  10.    Height          =   3570
  11.    Left            =   1185
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   3195
  16.    ScaleWidth      =   7245
  17.    Top             =   1380
  18.    Width           =   7335
  19.    Begin ListBox lstView 
  20.       Height          =   615
  21.       Left            =   120
  22.       TabIndex        =   8
  23.       Top             =   2280
  24.       Width           =   6855
  25.    End
  26.    Begin CheckBox chkView 
  27.       Caption         =   "CRC"
  28.       Height          =   375
  29.       Index           =   7
  30.       Left            =   2400
  31.       TabIndex        =   7
  32.       Top             =   1680
  33.       Value           =   1  'Checked
  34.       Width           =   1935
  35.    End
  36.    Begin CommandButton cmdOptView 
  37.       Caption         =   "&Help"
  38.       Height          =   495
  39.       Index           =   2
  40.       Left            =   5160
  41.       TabIndex        =   11
  42.       Top             =   1440
  43.       Width           =   1815
  44.    End
  45.    Begin CommandButton cmdOptView 
  46.       Cancel          =   -1  'True
  47.       Caption         =   "&Cancel"
  48.       Height          =   495
  49.       Index           =   1
  50.       Left            =   5160
  51.       TabIndex        =   10
  52.       Top             =   840
  53.       Width           =   1815
  54.    End
  55.    Begin CommandButton cmdOptView 
  56.       Caption         =   "&OK"
  57.       Default         =   -1  'True
  58.       Height          =   495
  59.       Index           =   0
  60.       Left            =   5160
  61.       TabIndex        =   9
  62.       Top             =   240
  63.       Width           =   1815
  64.    End
  65.    Begin CheckBox chkView 
  66.       Caption         =   "Attribute"
  67.       Height          =   375
  68.       Index           =   5
  69.       Left            =   2400
  70.       TabIndex        =   5
  71.       Top             =   720
  72.       Value           =   1  'Checked
  73.       Width           =   1935
  74.    End
  75.    Begin CheckBox chkView 
  76.       Caption         =   "Compression Type"
  77.       Height          =   375
  78.       Index           =   6
  79.       Left            =   2400
  80.       TabIndex        =   6
  81.       Top             =   1200
  82.       Value           =   1  'Checked
  83.       Width           =   1935
  84.    End
  85.    Begin CheckBox chkView 
  86.       Caption         =   "Time"
  87.       Height          =   375
  88.       Index           =   4
  89.       Left            =   2400
  90.       TabIndex        =   4
  91.       Top             =   240
  92.       Value           =   1  'Checked
  93.       Width           =   1935
  94.    End
  95.    Begin CheckBox chkView 
  96.       Caption         =   "Date"
  97.       Height          =   375
  98.       Index           =   3
  99.       Left            =   360
  100.       TabIndex        =   3
  101.       Top             =   1680
  102.       Value           =   1  'Checked
  103.       Width           =   1935
  104.    End
  105.    Begin CheckBox chkView 
  106.       Caption         =   "Compression Rate"
  107.       Height          =   375
  108.       Index           =   2
  109.       Left            =   360
  110.       TabIndex        =   2
  111.       Top             =   1200
  112.       Value           =   1  'Checked
  113.       Width           =   1935
  114.    End
  115.    Begin CheckBox chkView 
  116.       Caption         =   "Archive File Size"
  117.       Height          =   375
  118.       Index           =   1
  119.       Left            =   360
  120.       TabIndex        =   1
  121.       Top             =   720
  122.       Value           =   1  'Checked
  123.       Width           =   1935
  124.    End
  125.    Begin CheckBox chkView 
  126.       Caption         =   "File Size"
  127.       Height          =   375
  128.       Index           =   0
  129.       Left            =   360
  130.       TabIndex        =   0
  131.       Top             =   240
  132.       Value           =   1  'Checked
  133.       Width           =   1935
  134.    End
  135. '===================================================
  136. 'Sample VB program using UNLHA.DLL
  137. 'VBDeVew.Frm    (frmOptView)
  138. 'Original: Niiyama(HEROPA) SGV00153@niftyserve.or.jp
  139. 'English : Hitoshi Ozawa   h_ozawa@bekkoame.or.jp
  140. '===================================================
  141. Option Explicit
  142. Const BTN_OK = 0
  143. Const BTN_CANCEL = 1
  144. Const BTN_HELP = 2
  145. Const L_NAME = "  README.TXT  "
  146. Const L_ORGINAL = "      1528"
  147. Const L_PACKED = "       871"
  148. Const L_RATIO = "  57.0%"
  149. Const L_DATE = " 95-11-08"
  150. Const L_TIME = " 07:57:46"
  151. Const L_ATTRIB = " a--w"
  152. Const L_TYPE = " -lh5-"
  153. Const L_CRC = " 90E4"
  154. Sub chkView_Click (Index As Integer)
  155.     Dim strTmp As String
  156.     strTmp$ = L_NAME
  157.     If chkView(0).Value = CHECKED Then strTmp$ = strTmp$ & L_ORGINAL
  158.     If chkView(1).Value = CHECKED Then strTmp$ = strTmp$ & L_PACKED
  159.     If chkView(2).Value = CHECKED Then strTmp$ = strTmp$ & L_RATIO
  160.     If chkView(3).Value = CHECKED Then strTmp$ = strTmp$ & L_DATE
  161.     If chkView(4).Value = CHECKED Then strTmp$ = strTmp$ & L_TIME
  162.     If chkView(5).Value = CHECKED Then strTmp$ = strTmp$ & L_ATTRIB
  163.     If chkView(6).Value = CHECKED Then strTmp$ = strTmp$ & L_TYPE
  164.     If chkView(7).Value = CHECKED Then strTmp$ = strTmp$ & L_CRC
  165.     strTmp$ = strTmp$ & "  "
  166.     lstView.Clear
  167.     lstView.AddItem strTmp$
  168. End Sub
  169. Sub cmdOptView_Click (Index As Integer)
  170.     Dim intLoopCount    As Integer
  171.     Dim strTmp          As String
  172.     Dim intReturnCode   As Integer
  173.     Select Case Index
  174.     Case BTN_OK
  175.         For intLoopCount% = 0 To Len(gstrListViewOption$) - 1
  176.             strTmp$ = strTmp$ & CStr(chkView(intLoopCount%).Value)
  177.         Next intLoopCount
  178.         gstrListViewOption$ = strTmp$
  179.         Unload Me
  180.     Case BTN_CANCEL
  181.         Unload Me
  182.     Case BTN_HELP
  183.         intReturnCode% = WinHelp(frmArchive.hWnd, gstrHelpFile$, HELP_CONTEXT, ByVal HLP_DLGVIEWCONFIG&)
  184.     End Select
  185. End Sub
  186. Sub Form_Load ()
  187.     Dim intLoopCount As Integer
  188.     Dim strTmp As String
  189.     Dim intListWidth As Integer
  190.     Call SetControlPosition
  191.     Call SetControl3D
  192.     For intLoopCount% = 0 To Len(gstrListViewOption$) - 1
  193.         chkView(intLoopCount%).Value = Val(Mid$(gstrListViewOption$, intLoopCount% + 1, 1))
  194.     Next intLoopCount%
  195.     strTmp$ = L_NAME
  196.     If chkView(0).Value = CHECKED Then strTmp$ = strTmp$ & L_ORGINAL
  197.     If chkView(1).Value = CHECKED Then strTmp$ = strTmp$ & L_PACKED
  198.     If chkView(2).Value = CHECKED Then strTmp$ = strTmp$ & L_RATIO
  199.     If chkView(3).Value = CHECKED Then strTmp$ = strTmp$ & L_DATE
  200.     If chkView(4).Value = CHECKED Then strTmp$ = strTmp$ & L_TIME
  201.     If chkView(5).Value = CHECKED Then strTmp$ = strTmp$ & L_ATTRIB
  202.     If chkView(6).Value = CHECKED Then strTmp$ = strTmp$ & L_TYPE
  203.     If chkView(7).Value = CHECKED Then strTmp$ = strTmp$ & L_CRC
  204.     lstView.Clear
  205.     lstView.AddItem strTmp$
  206.     'Calculate height and width necessary to display
  207.     Me.FontName = lstView.FontName
  208.     intListWidth% = Me.TextWidth(L_NAME & L_ORGINAL & L_PACKED & L_RATIO & L_DATE & L_TIME & L_ATTRIB & L_TYPE & L_CRC & "  ") / Screen.TwipsPerPixelX
  209.     Call SetLstBoxHScrollBar(lstView, intListWidth%)
  210.     Call SetChildWindowPos(frmArchive, Me)
  211.     Call DeleteSwitchTo(Me)
  212.     Me.Icon = frmArchive.Icon
  213.     Me.Caption = APP_CAPTION & " - " & Me.Caption
  214.     Me.HelpContextID = HLP_DLGVIEWCONFIG
  215.     'If help file does not exist
  216.     If gstrHelpFile$ = "" Then cmdOptView(BTN_HELP).Enabled = False
  217. End Sub
  218. Sub lstView_Click ()
  219.     lstView.ListIndex = -1
  220. End Sub
  221. Sub SetControl3D ()
  222.     Me.AutoRedraw = True
  223.     Call Draw3DControl(lstView)
  224.     Call Draw3DForm(Me)
  225.     Me.AutoRedraw = False
  226. End Sub
  227. Sub SetControlPosition ()
  228.     Dim intLoopCount As Integer
  229.     Const DLG_SPACE = 4
  230.     chkView(0).Left = 2 * DLG_SPACE * Screen.TwipsPerPixelX
  231.     chkView(0).Top = 2 * DLG_SPACE * Screen.TwipsPerPixelY
  232.     chkView(0).Width = Me.TextWidth(chkView(1).Caption) + 8 * DLG_SPACE * Screen.TwipsPerPixelX
  233.     chkView(0).Height = Me.TextHeight("|") + DLG_SPACE * Screen.TwipsPerPixelY
  234.     chkView(0).BackColor = Me.BackColor
  235.     For intLoopCount% = 1 To 3
  236.         chkView(intLoopCount%).Left = chkView(intLoopCount% - 1).Left
  237.         chkView(intLoopCount%).Top = chkView(intLoopCount% - 1).Top + chkView(intLoopCount% - 1).Height + DLG_SPACE * Screen.TwipsPerPixelY
  238.         chkView(intLoopCount%).Width = chkView(intLoopCount% - 1).Width
  239.         chkView(intLoopCount%).Height = chkView(intLoopCount% - 1).Height
  240.         chkView(intLoopCount%).BackColor = Me.BackColor
  241.     Next intLoopCount%
  242.     chkView(4).Left = chkView(0).Left + chkView(0).Width + DLG_SPACE * Screen.TwipsPerPixelX
  243.     chkView(4).Top = chkView(0).Top
  244.     chkView(4).Width = chkView(0).Width
  245.     chkView(4).Height = chkView(0).Height
  246.     chkView(4).BackColor = Me.BackColor
  247.                  
  248.     For intLoopCount% = 5 To 7
  249.         chkView(intLoopCount%).Left = chkView(intLoopCount% - 1).Left
  250.         chkView(intLoopCount%).Top = chkView(intLoopCount% - 1).Top + chkView(intLoopCount% - 1).Height + DLG_SPACE * Screen.TwipsPerPixelY
  251.         chkView(intLoopCount%).Width = chkView(intLoopCount% - 1).Width
  252.         chkView(intLoopCount%).Height = chkView(intLoopCount% - 1).Height
  253.         chkView(intLoopCount%).BackColor = Me.BackColor
  254.     Next intLoopCount%
  255.     cmdOptView(0).Left = chkView(4).Left + chkView(4).Width * 1.5
  256.     cmdOptView(0).Top = chkView(4).Top
  257.     cmdOptView(0).Width = Me.TextWidth("
  258. (H)") + 5 * DLG_SPACE * Screen.TwipsPerPixelX
  259.     cmdOptView(0).Height = Me.TextHeight("OK") + 3 * DLG_SPACE * Screen.TwipsPerPixelY
  260.     For intLoopCount% = 1 To 2
  261.         cmdOptView(intLoopCount%).Left = cmdOptView(intLoopCount% - 1).Left
  262.         cmdOptView(intLoopCount%).Top = cmdOptView(intLoopCount% - 1).Top + cmdOptView(intLoopCount% - 1).Height + DLG_SPACE * Screen.TwipsPerPixelY
  263.         cmdOptView(intLoopCount%).Width = cmdOptView(intLoopCount% - 1).Width
  264.         cmdOptView(intLoopCount%).Height = cmdOptView(intLoopCount% - 1).Height
  265.     Next intLoopCount%
  266.     lstView.Left = chkView(0).Left
  267.     lstView.Top = cmdOptView(2).Top + cmdOptView(2).Height + 2 * DLG_SPACE * Screen.TwipsPerPixelY
  268.     lstView.Width = cmdOptView(0).Left + cmdOptView(0).Width - lstView.Left
  269.     lstView.Height = Me.TextHeight("|") + (3 + gintCYHSCROLL%) * Screen.TwipsPerPixelY
  270.     Me.Width = lstView.Left + lstView.Width + (2 * DLG_SPACE + 2 * gintCXDLGFRAME + 2) * Screen.TwipsPerPixelX
  271.     Me.Height = lstView.Top + lstView.Height + (2 * DLG_SPACE + 2 * gintCYDLGFRAME + gintCYCAPTION + 2) * Screen.TwipsPerPixelY
  272. End Sub
  273.